<html>
<head><meta charset="utf-8"><title>miri question from reddit · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html">miri question from reddit</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="136718636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136718636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136718636">(Oct 29 2018 at 16:42)</a>:</h4>
<p><a href="https://www.reddit.com/r/rust/comments/9sanq8/hey_rustaceans_got_an_easy_question_ask_here/e8o5znz" target="_blank" title="https://www.reddit.com/r/rust/comments/9sanq8/hey_rustaceans_got_an_easy_question_ask_here/e8o5znz">https://www.reddit.com/r/rust/comments/9sanq8/hey_rustaceans_got_an_easy_question_ask_here/e8o5znz</a></p>



<a name="136721963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136721963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136721963">(Oct 29 2018 at 17:34)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> ^</p>



<a name="136723960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136723960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136723960">(Oct 29 2018 at 18:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116155">@Jake Goulding</span> this is another instance of a bug <span class="user-mention" data-user-id="124288">@Oli</span> just wrote a fix for</p>



<a name="136723990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136723990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136723990">(Oct 29 2018 at 18:05)</a>:</h4>
<p>Which is blocked on nightly updating?</p>



<a name="136724016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724016">(Oct 29 2018 at 18:05)</a>:</h4>
<p>which hasnt landed in rustc yet</p>



<a name="136724020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724020">(Oct 29 2018 at 18:05)</a>:</h4>
<p>it hasnt even been r+'d^^</p>



<a name="136724086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724086">(Oct 29 2018 at 18:06)</a>:</h4>
<p>I wrote a comment on reddit with the relevant link</p>



<a name="136724114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724114">(Oct 29 2018 at 18:06)</a>:</h4>
<blockquote>
<p><code>1..=0</code> is the range of all possible integers</p>
</blockquote>
<p>wat.</p>



<a name="136724151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724151">(Oct 29 2018 at 18:07)</a>:</h4>
<p>seems like it should be <code>..</code> by itself.</p>



<a name="136724153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724153">(Oct 29 2018 at 18:07)</a>:</h4>
<p>yeah <span class="user-mention" data-user-id="119009">@eddyb</span> has strange logic^^</p>



<a name="136724158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724158">(Oct 29 2018 at 18:07)</a>:</h4>
<p>these ranges are wrapping</p>



<a name="136724167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724167">(Oct 29 2018 at 18:07)</a>:</h4>
<p>at "whatever the size of the scalar is"</p>



<a name="136724243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724243">(Oct 29 2018 at 18:08)</a>:</h4>
<p>wraparound ranges are super useful</p>



<a name="136724248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724248">(Oct 29 2018 at 18:08)</a>:</h4>
<p>and LLVM uses them</p>



<a name="136724258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724258">(Oct 29 2018 at 18:09)</a>:</h4>
<p>it means you don't need a separate concept of a signed range and an unsigned range</p>



<a name="136724266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724266">(Oct 29 2018 at 18:09)</a>:</h4>
<p>which is what we had before</p>



<a name="136724301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724301">(Oct 29 2018 at 18:09)</a>:</h4>
<p>wrapped ranges are great but using <code>RangeInclusive</code> for them is a bad hack</p>



<a name="136724309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724309">(Oct 29 2018 at 18:09)</a>:</h4>
<p>that type comes with a <code>contains</code> method that's just plain wrong now</p>



<a name="136724371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724371">(Oct 29 2018 at 18:10)</a>:</h4>
<p>is there a difference in <code>1..=0</code> and <code>2..=1</code>, etc.?</p>



<a name="136724610"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724610" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724610">(Oct 29 2018 at 18:14)</a>:</h4>
<p>no</p>



<a name="136724843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724843">(Oct 29 2018 at 18:17)</a>:</h4>
<p>ahhhh yeah I just never got around to writing a proper type</p>



<a name="136724845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136724845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136724845">(Oct 29 2018 at 18:17)</a>:</h4>
<p>that handles all the operations correctly</p>



<a name="136725329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136725329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136725329">(Oct 29 2018 at 18:24)</a>:</h4>
<p>I wonder what the outcome will be of these "internal" bits leaking out to real humans via such things as Miri error messages.</p>



<a name="136725691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136725691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136725691">(Oct 29 2018 at 18:30)</a>:</h4>
<p>probably the error messages shouldn't use that notation when there is actual wrapping going on</p>



<a name="136725703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136725703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136725703">(Oct 29 2018 at 18:30)</a>:</h4>
<p>I was just too lazy to implement better pretty printing^^</p>



<a name="136725707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri%20question%20from%20reddit/near/136725707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/miri.20question.20from.20reddit.html#136725707">(Oct 29 2018 at 18:30)</a>:</h4>
<p>(the error msg is in rustc btw, and can also occur during CTFE)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>